﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mogre;

namespace WastedMechanics.CharState
{
    public abstract class CharStateLand : CharState
    {
        string AnimationName;

        public CharStateLand(Character chr, string animName)
            : base(chr)
        {
            AnimationName = animName;
        }

        public override void Enter()
        {
            Character.ResetAnimation(AnimationName);
            Character.SetAnimation(AnimationName);
        }

        public override void Update()
        {
            Character.Body.Velocity = Vector3.ZERO;
            if (Character.AnimBlender.Target.TimePosition > Character.AnimBlender.Target.Length * 0.99f)
                Character.SwitchState(GetIdleState());
        }

        public abstract CharState GetIdleState();
    }
}
